package com.itcam.phaseii.final_;

// 编写一个程序，能够计算圆形的面积，要求圆周率为3.14.
public class FinalExercise01 {
    public static void main(String[] args) {
        Circle circle = new Circle(9);
        System.out.println(circle.calArea());
    }
}

class Circle {
    private double r;
    //private final double PI = 3.14;
    private final double PI;

    public Circle(double r) {
        this.r = r;
//        PI = 3.14;
    }

    {
        PI = 3.14;
    }

    public double calArea() {
        return r * r * PI;
    }


}
